<template>
    <div class="footer">
        <div style="width: 33%;float: left">
            <input type="checkbox" id="checkAll" :checked="checkAll" @change="changeALl">
            <label for="checkAll">全选</label>
        </div>
        <div style="float: left;width: 33%;color: red;" class="box">合计:￥{{sumPrice.toFixed(2)}}</div>
        <div style="float: right;width: 33%;" class="box">
            <button>结算({{count}})</button>
        </div>
    </div>
</template>

<script>
    export default {
        name: "Footer",
        props: {
            'checkAll': {
                type: Boolean,
                default: false
            },
            'sumPrice': {
                type: Number,
                default: 0
            },
            'count': {
                type: Number,
                default: 0
            }
        },
        methods: {
            changeALl(e) {
                this.$emit('changeAll', e.target.checked);
            }
        }
    }
</script>

<style scoped>
    .footer {
        height: 30px;
        width: 100%;
        background-color: #c9e2b3;
        font-weight: bold;
        position: fixed;
        bottom: 0;
    }

    .box {
        display: flex;
        justify-content: center;
        align-items: center;
    }
</style>